package com.mall.utils;

import org.springframework.stereotype.Component;

/**
 * @Description ThreadLocal工具类传递数据
 * @ClassName ThreadLocalUtils
 * @Author cxx
 * @Date 2023/4/24 20:20
 * @Version 1.0
 */
@Component
public class ThreadLocalUtils {
    ThreadLocal<Object> threadLocal = new ThreadLocal<>();

    public void set(Object obj) {
        threadLocal.set(obj);
    }

    public Object get() {
        return threadLocal.get();
    }

    public void remove() {
        threadLocal.remove();
    }
}
